<template>
    <div class="page-wrap">
        <!-- <div style="color: rgb(27, 76, 184);margin-bottom: 15px">
            <div class="addressIcon"></div>
            <span>当前位置：</span>
            <span style="cursor: pointer" @click="returnCompany">裁判审核</span>
            <Icon type="ios-arrow-forward" color="rgb(27, 76, 184)" size="16" />
            <span style="color: #333">{{$route.query.taskName}}</span>
            <Icon type="ios-arrow-forward" color="rgb(27, 76, 184)" size="16" />
            <span style="color: #333">审核报告</span>
        </div> -->
        <!-- :style="{height: contentHei === 'auto' ? contentHei : `${contentHei}px`}" -->

        <div class="page-content">
            <div class="img-header">
                <!-- <div style="font-weight: 700; font-size: 18px">审核报告</div> -->
                <div style="display: flex; flex-wrap: wrap" class="page-wrap-query">
                    <Button type="primary" @click="downloadAllReports" :loading="downloading" ghost
                        >打包下载所有报告</Button
                    >
                    <Select filterable
                        v-model="taskId"
                        placeholder="任务"
                        @on-change="changeTask"
                        style="width: 140px; margin-left: 8px"
                    >
                        <Option
                            :value="item.id"
                            v-for="item in taskList"
                            :key="item.id"
                            :title="item.name"
                            >{{ item.name }}</Option
                        >
                    </Select>
                    <Input
                        v-model.trim="targetName"
                        placeholder="目标"
                        style="width: 120px; margin-left: 8px"
                        @on-change="selectStatus"
                    ></Input>
                    <Select filterable
                        v-model="type"
                        filterable
                        placeholder="报告类型"
                        clearable
                        style="width: 120px; margin-left: 8px"
                        @on-change="selectStatus"
                    >
                        <Option :value="1">攻击报告</Option>
                        <Option :value="2">防御报告</Option>
                    </Select>
                    <Select filterable
                        transfer
                        v-model="publicTarget"
                        placeholder="公共目标"
                        filterable
                        clearable
                        style="width: 120px; margin-left: 8px"
                        @on-change="selectStatus"
                    >
                        <Option value="1">是</Option>
                        <Option value="0">否</Option>
                    </Select>
                    <Select filterable
                        v-model="industry"
                        filterable
                        placeholder="行业"
                        clearable
                        style="width: 120px; margin-left: 8px"
                        @on-change="selectStatus"
                    >
                        <Option
                            :value="item.dictid"
                            v-for="item in industryList"
                            :key="item.dictid"
                            :title="item.dictname"
                            >{{ item.dictname }}</Option
                        >
                    </Select>
                    <Select filterable
                        v-model="attackType"
                        filterable
                        placeholder="攻击类型"
                        clearable
                        style="width: 120px; margin-left: 8px"
                        @on-change="selectStatus"
                    >
                        <Option
                            :value="item.dictid"
                            v-for="item in attackList"
                            :key="item.dictid"
                            :title="item.dictname"
                            >{{ item.dictname }}</Option
                        >
                    </Select>
                    <Cascader
                        :render-format="renderFormat"
                        transfer
                        :data="extent4DefenseTypesData"
                        v-model="defenseTypes"
                        placeholder="防守类型"
                        style="width: 120px; margin-left: 8px"
                        filterable
                        clearable
                        @on-change="selectStatus"
                    ></Cascader>
                    <Cascader
                        :render-format="renderFormat"
                        transfer
                        :data="extent4InjuryData"
                        v-model="attackLevel"
                        placeholder="危害程度"
                        style="width: 120px; margin-left: 8px"
                        filterable
                        clearable
                        @on-change="selectStatus"
                    ></Cascader>
                    <Select filterable
                        v-model="level"
                        placeholder="危险等级"
                        clearable
                        style="width: 120px; margin-left: 8px"
                        @on-change="selectStatus"
                    >
                        <Option value="high">高危</Option>
                        <Option value="middle">中危</Option>
                        <Option value="low">低危</Option>
                    </Select>
                    <Select filterable
                        v-model="statusModel"
                        placeholder="审核状态"
                        clearable
                        style="width: 120px; margin-left: 8px"
                        @on-change="selectStatus"
                    >
                        <Option value="1">未审核</Option>
                        <Option value="2">已通过</Option>
                        <Option value="3">已驳回</Option>
                    </Select>
                    <Button
                        class="header-btn"
                        type="primary"
                        ghost
                        style="height: 32px; margin-left: 8px"
                        @click="refreshSceneList"
                    >
                        <i class="el-icon-refresh-right" />
                    </Button>
                </div>
            </div>
            <!-- <Divider /> -->
            <div class="content-wrap">
                <TableList :columns="reportCol" :data="reportList"></TableList>
            </div>
            <div
                style="display: flex; justify-content: center; margin: 15px 0"
                v-if="reportList.length > 0"
            >
                <Page
                    :total="dataTotal"
                    @on-change="changePageNum"
                    show-total
                    show-elevator
                    :page-size="pageSize"
                    :current="reportPage"
                />
            </div>
        </div>

        <!--报告文件-->
        <Modal
            v-model="fileModal"
            :title="`${this.currentType === 2 ? '防御报告' : '攻击报告'}文件列表`"
            width="800px"
            :mask-closable="false"
        >
            <Table :border="true" :columns="fileCol" :data="fileList"></Table>
            <div slot="footer">
                <Button @click="fileModal = false">关闭</Button>
                <Button
                    @click="downloadReports"
                    type="primary"
                    v-show="currentType !== 2"
                    :loading="downloading1"
                    >打包下载</Button
                >
            </div>
        </Modal>
        <!--审核报告-->
        <Modal
            v-model="reviewReportModal"
            :title="reviewReportTitle"
            width="800px"
            :footer-hide="true"
            @on-visible-change="changeModalStatus"
            :mask-closable="false"
        >
            <div>
                <Form
                    ref="formValidate"
                    :model="formValidate"
                    :rules="ruleValidate"
                    :label-width="120"
                >
                    <FormItem
                        v-if="currentTarget.type === 1"
                        label="攻击类型："
                        prop="attackType"
                        key="attackType"
                    >
                        <Select filterable
                            v-model="formValidate.attackType"
                            placeholder="选择攻击类型"
                            class="reset-color"
                        >
                            <Option
                                :value="item.dictid"
                                v-for="item in attackList"
                                :key="item.dictid"
                                :title="item.dictname"
                                >{{ item.dictname }}</Option
                            >
                        </Select>
                    </FormItem>
                    <FormItem
                        v-if="currentTarget.type === 2"
                        label="防御类型："
                        prop="defenseType"
                        key="defenseType"
                    >
                        <Cascader
                            :render-format="renderFormat"
                            transfer
                            :data="extent4DefenseTypesData"
                            v-model="formValidate.defenseType"
                            placeholder="选择防守类型"
                            class="reset-color"
                            filterable
                            clearable
                        ></Cascader>
                    </FormItem>
                    <FormItem
                        label="危害程度 ："
                        v-if="currentTarget.type === 1"
                        prop="attackLevel"
                    >
                        <Cascader
                            :render-format="renderFormat"
                            transfer
                            :data="extent4InjuryData"
                            v-model="formValidate.attackLevel"
                            placeholder="请选择危害程度"
                            filterable
                            clearable
                        ></Cascader>
                    </FormItem>
                    <FormItem label="审核意见：" prop="approvalInfo">
                        <Input
                            v-model.trim="formValidate.approvalInfo"
                            clearable
                            type="textarea"
                            :maxlength="200"
                            :autosize="{ minRows: 2, maxRows: 5 }"
                            placeholder="审核意见"
                        ></Input>
                    </FormItem>
                    <!--<FormItem label="分数：" prop="score">-->
                    <!--<InputNumber :min="0" :step="1" v-model="formValidate.score"></InputNumber>-->
                    <!--</FormItem>-->
                    <FormItem label="结果：" prop="status">
                        <RadioGroup v-model="formValidate.status" type="button">
                            <Radio label="2">通过</Radio>
                            <Radio label="3">驳回</Radio>
                        </RadioGroup>
                    </FormItem>
                    <FormItem
                        label="危险等级："
                        prop="level"
                        v-if="formValidate.status === '2' && currentTarget.type === 1"
                    >
                        <RadioGroup v-model="formValidate.level" type="button">
                            <Radio label="high">高危</Radio>
                            <Radio label="middle">中危</Radio>
                            <Radio label="low">低危</Radio>
                        </RadioGroup>
                    </FormItem>
                    <FormItem
                        :label="this.formValidate.type === 1 ? '防守方扣分：' : '防守方得分：'"
                        prop="score"
                        v-if="formValidate.status === '2'"
                    >
                        <Input
                            v-model="formValidate.score"
                            number
                            :placeholder="`请输入${this.formValidate.type === 1 ? '扣' : '得'}分值`"
                            class="points-number"
                        ></Input>
                        <Alert
                            type="warning"
                            show-icon
                            v-show="pointsTip && formValidate.status === '2'"
                            class="points-tip"
                            >{{ this.formValidate.type === 1 ? '扣分标准：' : '得分标准：'
                            }}{{ pointsTip }}</Alert
                        >
                    </FormItem>
                    <FormItem>
                        <Button
                            type="primary"
                            @click="saveReport('formValidate')"
                            :loading="submitBtnLoad"
                            >确定</Button
                        >
                    </FormItem>
                </Form>
            </div>
        </Modal>
        <!--上传文件-->
        <Modal
            v-model="uploadModal"
            :mask-closable="false"
            width="500"
            :footer-hide="true"
            title="上传文件"
        >
            <Form ref="creatFormValidate" :model="creatFormValidate" :label-width="100">
                <FormItem label="上传文件" prop="file">
                    <Upload
                        ref="uploadIcon"
                        v-model="creatFormValidate.file"
                        :action="upLoadIconUrl"
                        :multiple="false"
                        :before-upload="handleUploadIcon"
                    >
                        <Button icon="ios-cloud-upload-outline">选择文件</Button>
                    </Upload>
                    <div v-if="creatFormValidate.file !== null">
                        文件名称: {{ creatFormValidate.file.name }}
                    </div>
                </FormItem>
                <FormItem>
                    <Button type="primary" @click="creatIconHandleSubmit()" :loading="uploadLoading"
                        >确定</Button
                    >
                    <Button style="margin-left: 8px" @click="cancleUpload">取消</Button>
                </FormItem>
            </Form>
        </Modal>
        <package-progress
            :show="showProgress"
            :progress="progress"
            :status="progressStatus"
            @change="change"
            title="打包进度"
        ></package-progress>
        <Modal
            width="800"
            v-model="modalDataShow"
            title="报告提交"
            @on-visible-change="changeVisible"
            class="create-vulnerability-modal">
            <Form
            ref="formInline"
            :label-width="110"
            :model="formInline"
            :rules="ruleInline">
            <FormItem prop="name" label="漏洞名称">
                <Input clearable v-model="formInline.name" :disabled="true"  placeholder="请输入漏洞名称"></Input>
            </FormItem>
            <div class="inline">
                <FormItem prop="target" label="应用名称">
                    <Select filterable transfer clearable v-model="formInline.target" placeholder="请选择应用名称" :disabled="true">
                        <Option v-for="item in targetList" :key="item.targetId" :value="item.targetId">{{ item.company }}</Option>
                    </Select>
                </FormItem>
                <FormItem prop="url"  label="漏洞URL地址" v-show="formInline.belong == '行内机构'">
                    <Input :disabled="true" v-model="formInline.url" placeholder="请输入漏洞URL地址"></Input>
                </FormItem>
            </div>
            <div class="inline" v-show="formInline.belong == '行内机构'">
                <FormItem prop="category" label="漏洞来源">
                    <Select filterable :disabled="true" transfer clearable v-model="formInline.category" placeholder="请选择漏洞来源">
                        <Option v-for="item in categoryList" :value="item.value" :key="item.value">{{ item.label }}</Option>
                    </Select>
                </FormItem>
                <FormItem prop="isFix"  label="漏洞是否修复">
                    <Select filterable :disabled="true" transfer v-model="formInline.isFix" placeholder="漏洞是否修复">
                        <Option value="Y">是</Option>
                        <Option value="N">否</Option>
                    </Select>
                </FormItem>
            </div>
            <FormItem prop="discoverTime"  label="漏洞发现时间">
                <DatePicker type="date" :value="formInline.discoverTime" placeholder="请选择漏洞发现时间" :disabled="true"></DatePicker>
            </FormItem>
            <FormItem prop="description"  label="漏洞描述">
                <quill-editor
                    v-model="formInline.description"
                    class="editor"
                    :disabled="true"
                    ref="descriptionQuillEditor"
                    :options="editorOption"
                    @blur="onEditorBlur($event)"
                    @focus="onEditorFocus($event)"
                    @change="onEditorChange($event,'descriptionQuillEditor')">
                </quill-editor>
            </FormItem>
            <FormItem prop="detail"  label="漏洞详情" :rules="[{required: formInline.belong == '行内机构', trigger: 'blur,change', message: '漏洞详情不能为空'}]">
                <quill-editor
                    v-model="formInline.detail"
                    class="editor"
                    :disabled="true"
                    ref="detailQuillEditor"
                    :options="editorOption"
                    @blur="onEditorBlur($event)"
                    @focus="onEditorFocus($event)"
                    @change="onEditorChange($event,'detailQuillEditor')">
                </quill-editor>
            </FormItem>
            <FormItem prop="sulotion"  label="整改意见" v-show="formInline.belong == '行内机构'">
                <quill-editor
                    :disabled="true"
                    v-model="formInline.sulotion"
                    class="editor"
                    ref="sulotionQuillEditor"
                    :options="editorOption"
                    @blur="onEditorBlur($event)"
                    @focus="onEditorFocus($event)"
                    @change="onEditorChange($event,'sulotionQuillEditor')">
                </quill-editor>
            </FormItem>
            </Form>
            <div slot="footer" class="footer">
                <Button type="primary" @click="modalDataShow = false">确定</Button>
            </div>
        </Modal>
    </div>
</template>
<script>
import {
    reportList,
    reportFileData,
    reviewReport,
    downloadReports,
    taskList,
} from '@/api/referee.js';
import defenseFile from './defenseFile.vue';
import screenRecord from './screenRecord.vue';
import PackageProgress from '@/components/package-progress/package-progress.vue';
import { allDirection } from '@/api/dict';
import LevelMixin from '@/mixin/levelMixin';
import { queryAllotTopoTargetList_old } from '@/api/drill_compete'
import { validateName } from '@/libs/reg'
import { mapState } from 'vuex'
import Quill from 'quill'
import {quillEditor} from "vue-quill-editor"; // 调用编辑器
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
// 粘贴图片上传
import {ImageExtend} from '@/components/creatPage/image-parse'
Quill.register('modules/ImageExtend', ImageExtend)
import ImageResize from 'quill-image-resize-module'
Quill.register('modules/ImageResize', ImageResize);
const toolbarOptions = [
    ["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线
    ["blockquote", "code-block"], // 引用  代码块
    [{ header: 1 }, { header: 2 }], // 1、2 级标题
    [{ list: "ordered" }, { list: "bullet" }], // 有序、无序列表
    [{ script: "sub" }, { script: "super" }], // 上标/下标
    [{ indent: "-1" }, { indent: "+1" }], // 缩进
    // [{'direction': 'rtl'}],                         // 文本方向
    [{ size: ["small", false, "large", "huge"] }], // 字体大小
    [{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
    [{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
    [{ align: [] }], // 对齐方式
    ["clean"], // 清除文本格式
    ['link',"image"] // 链接、图片、视频
]

export default {
    components: { defenseFile, screenRecord, PackageProgress, quillEditor },
    props:{
        hwExtentionType:{
            type: Number,
            default: 100 // 默认给的100 无用值 默认给0 会有这个值
        },
        hwTypeExtension:{
            type: Number,
            default: 100
        },
    },
    mixins: [LevelMixin],
    data() {
        const validatePoints = (rule, value, callback) => {
            if (value || value === 0) {
                if (!Number.isInteger(value)) {
                    callback(new Error('请输入整数'));
                } else {
                    if (value < 0 || value > 100000) {
                        callback(new Error('分值范围0~100000'));
                    } else {
                        callback();
                    }
                }
            } else {
                callback(new Error('不能为空'));
            }
        };
        return {
            targetName: '',
            publicTarget: '',
            defenseTypes: [],
            attackLevel: [],
            currentTarget: {},
            progressStatus: 'active',
            progress: 0,
            showProgress: false, // 展示进度
            downloading: false,
            downloading1: false,
            downloading2: false,
            currentFileId: '',
            level: '',
            industry: '',
            industryList: [],
            attackType: '',
            attackList: [],
            // 页面设置
            fullHeight: document.documentElement.clientHeight,
            fullWidth: document.documentElement.clientWidth,
            contentHei: 'auto',
            // 工程 任务 id
            projectId: '',
            taskList: [],
            taskId: '',
            taskName: '',
            // 报告列表
            dataTotal: 0,
            reportList: [],
            reportCol: [
                //                  {
                //                      type:'index',
                //                      width:60,
                //                  },
                {
                    title: '报告名称',
                    key: 'reportName',
                    width: 200,
                    placement: 'top-left',
                    tooltip: true,
                },
                {
                    title:'报告ID',
                    key:'id',
                    width:100,
                    placement:'top-left',
                    tooltip:true,
                    show:()=>{
                        return [0,2].includes(this.hwTypeExtension) && [2,3].includes(this.hwExtentionType)
                    },
                    render: (h, params) => {
                        let isDailyDrill = false // 是否为日常渗透
                        const extension = JSON.parse( params.row.extension)
                        if(extension.hwType==0&&extension.hwExtentionType==2){
                        isDailyDrill = true
                        }
                        return h('p',{
                            style: {
                                display: !isDailyDrill?'none':'inline-block'
                            }
                        }, params.row.id.slice(-4))
                    }
                },
                {
                    title: '场景名称',
                    key: 'testName',
                    width: 200,
                    placement: 'top-left',
                    tooltip: true,
                },
                {
                    title: '目标',
                    key: 'targetName',
                    width: 100,
                    tooltip: true,
                },
                {
                    title: '提交人',
                    key: 'creatorName',
                    width: 100,
                    tooltip: true,
                },
                {
                    title: '团队名称',
                    key: 'groupName',
                    width: 100,
                    tooltip: true,
                },
                {
                    title: '危险等级',
                    key: 'level',
                    width: 100,
                    tooltip: true,
                    render: (h, params) => {
                        let obj = this.mixinPaserLevel(params.row.level);
                        return h(
                            'span',
                            {
                                style: {
                                    color: obj.color,
                                },
                            },
                            obj.text
                        );
                    },
                },
                {
                    title: '危害程度',
                    key: 'attackLevelName',
                    align: 'center',
                    width: 150,
                    tooltip: true,
                    render: (h, params) => {
                      return h('span',  this.textNull2Wu(params.row.attackLevelName));
                    },
                },
                {
                    title: '防守方扣分',
                    key: 'score1',
                    align: 'center',
                    width: 120,
                    tooltip: true,
                    filter:(score,data) => data.type !== 2 ? data.score : '-'
                },
                {
                    title: '防守方得分',
                    key: 'score2',
                    align: 'center',
                    width: 120,
                    tooltip: true,
                    render: (h, params) => {
                        return h('span', params.row.type === 2 ? params.row.score : '-');
                    },
                },
                {
                    title: '行业',
                    key: 'industryName',
                    width: 100,
                    tooltip: true,
                },
                {
                    title: '攻击类型',
                    key: 'attackTypeName',
                    width: 100,
                    tooltip: true,
                    render: (h, params) => {
                      return h('span',  this.textNull2Wu(params.row.attackTypeName));
                    },
                },
                {
                    title: '防守类型',
                    key: 'defenseTypeName',
                    width: 100,
                    tooltip: true,
                    render: (h, params) => {
                      return h('span',  this.textNull2Wu(params.row.defenseTypeName));
                    },
                },
                {
                    title: '任务名称',
                    key: 'taskName',
                    width: 100,
                    tooltip: true,
                },
                {
                    title: '报告类型',
                    key: 'type',
                    placement: 'top-right',
                    width: 100,
                    render: (h, params) => {
                        return h('span', params.row.type === 2 ? '防御报告' : '攻击报告');
                    },
                },
                {
                    title: '审核状态',
                    key: 'status',
                    width: 100,
                    placement: 'top-right',
                    render: (h, params) => {
                        let color = '';
                        let text = '';
                        let status = params.row.status ? params.row.status : 1;
                        if (status === 3) {
                            color = 'error';
                            text = '已驳回';
                        } else if (status === 2) {
                            color = 'success';
                            text = '已通过';
                        } else if (status === 1) {
                            color = 'primary';
                            text = '未审核';
                        }
                        return h('span', [
                            h(
                                'Tag',
                                {
                                    props: {
                                        //                                      type:'dot',
                                        color: color,
                                    },
                                },
                                text
                            ),
                        ]);
                    },
                },
                {
                    title: '查看报告详情',
                    key: 'creatorName11',
                    placement: 'top-right',
                    width: 120,
                    render: (h, params) => {
                        return h('div', [
                            h(
                                'Button',
                                {
                                    props: {
                                        type: 'primary',
                                        size: 'small',
                                    },
                                    on: {
                                        click: () => {
                                            let hwExtentionType = JSON.parse(params.row.extension).hwExtentionType
                                            this.modelVmInEnable=  JSON.parse(params.row.extension).vmInEnable
                                            if(hwExtentionType == 2 && params.row.type != 2) {
                                                this.formInline = JSON.parse(params.row.largeExerciseRecord)
                                                if(params.row.accountInventoryList && params.row.accountInventoryList.length) {
                                                    this.formInline.description = params.row.accountInventoryList[0]
                                                }else {
                                                    this.formInline.description = params.row.accountInventory
                                                }
                                                if(params.row.trojanInventoryList && params.row.trojanInventoryList.length) {
                                                    this.formInline.detail = params.row.trojanInventoryList[0]
                                                }else {
                                                    this.formInline.detail = params.row.trojanInventory
                                                }
                                                if(params.row.achievementList && params.row.achievementList.length) {
                                                    this.formInline.sulotion = params.row.achievementList[0]
                                                }else {
                                                    this.formInline.sulotion = params.row.achievement
                                                }
                                                
                                               
                                                this.modalDataShow = true
                                            }else {
                                                let { id, type, targetName, groupName } = params.row;
                                                this.getFileList(id, type, targetName, groupName);
                                            }
                                        },
                                    },
                                },
                                '查看'
                            ),
                        ]);
                    },
                },
                {
                    title: '提交时间',
                    key: 'createTime',
                    width: 200,
                    tooltip: true,
                },
                {
                    title: '审核操作',
                    align: 'center',
                    width: 100,
                    key: 'operation',
                    placement: 'top-right',
                    render: (h, params) => {
                        let status = params.row.status ? params.row.status : 1;
                        let arr = [];
                        if (status === 1) {
                            arr.push(
                                h(
                                    'Button',
                                    {
                                        props: {
                                            type: 'primary',
                                            size: 'small',
                                        },
                                        on: {
                                            click: () => {
                                                this.reviewBtn(params.row);
                                            },
                                        },
                                    },
                                    '审核'
                                )
                            );
                        } else if (status === 2) {
                            arr.push(
                                h(
                                    'Button',
                                    {
                                        props: {
                                            type: 'success',
                                            size: 'small',
                                        },
                                        on: {
                                            click: () => {
                                                this.modifyReviewBtn(params.row);
                                            },
                                        },
                                    },
                                    '重新审核'
                                )
                                // h('Button', {
                                //     props: {
                                //         type: 'info',
                                //         size: 'small',
                                //     },
                                //     style:{
                                //         marginLeft:'8px'
                                //     },
                                //     on: {
                                //         'click': ()=>{
                                //             this.uploadFile(params.row)
                                //         },
                                //     }
                                // }, '补充报告文件')
                            );
                        } else if (status === 3) {
                            arr.push(
                                h(
                                    'Button',
                                    {
                                        props: {
                                            type: 'info',
                                            size: 'small',
                                        },
                                        on: {
                                            click: () => {
                                                this.modifyReviewBtn(params.row);
                                            },
                                        },
                                    },
                                    '重新审核'
                                )
                            );
                        }
                        return h('div', arr);
                    },
                },
            ],
            // 报告文件列表
            reportName: '',
            fileModal: false,
            fileList: [],
            defeFileList: [],
            connectRecords: [],
            fileCol: [
                {
                    type: 'expand',
                    width: 50,
                    render: (h, params) => {
                      
                        let timerange = this.attackStartTime + ' - ' + this.attackEndTime
                        if(!this.attackStartTime){
                          timerange = '-'
                        }
                        
                        let modelVmInEnable=  this.modelVmInEnable
                      
                        return h('div', [
                            h(defenseFile, {
                                props: {
                                    row: this.defeFileList,
                                },
                            }),
                            h('div', {}, [
                                h(
                                    'h3',
                                    {
                                        style: {
                                            margin: '10px 0',
                                            display:modelVmInEnable?'block':'none'
                                        },
                                    },
                                    '攻击时间：' + timerange
                                ),
                            ]),
                            h(screenRecord, {
                                props: {
                                    row: this.connectRecords,
                                },
                                style: {
                                  display:modelVmInEnable?'block':'none'
                                },
                            }),
                        ]);
                    },
                },
                {
                    type: 'index',
                    width: 60,
                },
                {
                    title: '文件名称',
                    key: 'name',
                },
                {
                    title: '提交人',
                    key: 'creatorName',
                },
                {
                    title: '人员类型',
                    key: 'userType',
                },
                {
                    title: '下载',
                    key: 'creatorName',
                    render: (h, params) => {
                        return h('div', [
                            h(
                                'Button',
                                {
                                    props: {
                                        type: 'primary',
                                        size: 'small',
                                        loading:
                                            this.downloading2 &&
                                            this.currentFileId === params.row.id,
                                    },
                                    on: {
                                        click: () => {
                                            this.downLoadFile(params.row);
                                        },
                                    },
                                },
                                '下载'
                            ),
                        ]);
                    },
                },
            ],
            // 审核报告
            reportID: '',
            reviewReportModal: false,
            extent4InjuryData: [],
            extent4DefenseTypesData: [],
            formValidate: {
                attackType: '',
                approvalInfo: '',
                status: '',
                attackLevel: [],
                defenseType: [],
                // score:0,
            },
            ruleValidate: {
                attackType: [{ required: true, message: '请选择攻击类型', trigger: 'change' }],
                attackLevel: [
                    {
                        required: true,
                        type: 'array',
                        min: 1,
                        message: '请选择危害程度',
                        trigger: 'change',
                    },
                ],
                defenseType: [
                    {
                        required: true,
                        type: 'array',
                        min: 1,
                        message: '请选择防守类型',
                        trigger: 'change',
                    },
                ],
                approvalInfo: [
                    { required: true, message: '请填写审核意见', trigger: 'change' },
                    {
                        type: 'string',
                        min: 20,
                        message: '审核意见最少输入20个字符',
                        trigger: 'change',
                    },
                ],
                status: [{ required: true, message: '请选择审核结果', trigger: 'change' }],
                level: [{ required: true, message: '请选择危险等级', trigger: 'change' }],
                score: [{ required: true, validator: validatePoints, trigger: 'change' }],
            },
            submitBtnLoad: false,
            // 上传文件
            uploadLoading: false,
            uploadModal: false,
            upLoadIconUrl: `${this.baseURL}/referee/referee/upload`,
            creatFormValidate: {
                file: null,
            },
            // 过滤
            serchProjectName: '',
            serchSceneName: '',
            serchTaskName: '',
            reportPage: 1,
            pageSize: 10,
            statusModel: '',
            modelVmInEnable:true,
            attackStartTime: '',
            attackEndTime: '',
            currentType: '',
            type: '',
            // 日常渗透
            modalDataShow: false,
            formInline: {
                name: '',
                belong: '行内机构',
                targetName: '',
                url: '',
                description: '',
                detail: '',
                sulotion: '',
                category: '',
                isFix: '',
                discoverTime: '',
            },
            ruleInline: {
                name: [
                    { required: true, message: `漏洞名称不能为空`, trigger: 'blur,change' },
                    { type:'string',max: 64,trigger:'blur,change',message:'最多输入64个字符' },
                    { validator:validateName, trigger: 'blur,change' }
                ],
                description: [
                    { required: true, message: `漏洞描述不能为空`, trigger: 'blur' }
                ],
                detail: [
                    { required: true, message: `漏洞详情不能为空`, trigger: 'blur' }
                ],
                url: [
                    { required: true, message: `URL不能为空`, trigger: 'blur' }
                ],
                targetName: [
                    { required: true, message: `请选择应用名称`, trigger: 'change' }
                ],
                visibility: [
                    { required: true, message: `请选择漏洞可见范围`, trigger: 'change' }
                ],
            },
            //编辑器
            editorOption: {
            modules: {
                clipboard: {},
                toolbar: {
                    container:toolbarOptions,//工具菜单栏配置
                    handlers: {
                        // 'image': (value)=> {
                        //     if (value) {
                        //         this.insertImg()
                        //     } else {
                        //         this.quill.format('image', false);
                        //     }
                        // }
                    }
                },
                ImageExtend:{
                loading: true,
                name: 'file',
                size:2,
                sizeError:() => {
                    this.$Message.error('图片大小不能超过2M');
                },
                headers: (xhr) => {
                        xhr.setRequestHeader('Authorization',cookieUse.getCookie('desig-token'))
                    },  // 可选参数 设置请求头部
                start: () => {//开始上传触发事件

                },
                change: (xhr, FormData) => {

                },
                action: '/api/minio/upload/permanent?visibility=company&type=images&bucket=images',
                error:() => {
                    this.$Message.error('文件上传失败');
                },
                response: (res) => {
                    if(res.code == 1){
                        let src = res.data;
                        return `/Learn/${src}`
                    }else if(res.code == -9599){
                    this.$Message.error({
                    content:res.message,
                    duration:2,
                })
                setTimeout(()=>{
                    this.$router.push({
                                        path:'/login',
                                    })
                    cookieUse.setCookie('desig-token','',0)
                },2000)
                    }else{
                    this.$Message.error('文件上传失败');
                    }
                }
                },
                ImageResize: {
                modules: [ 'Resize', 'DisplaySize']
                }
            },
            placeholder: '请输入内容，可以在编辑器直接贴图', //提示
            },
            categoryList: [
            { label: '渗透', value: 3},
            { label: '众测', value: 4},
            { label: '评估', value: 5},
            { label: '测试', value: 6},
            ],
            targetList: []
        };
    },
    created() {
        this.sceneId = this.$route.query.sceneId;
        this.sceneName = this.$route.query.sceneName;
        this.projectId = this.$route.query.projectId;
        this.queryAllotTopoTargetList()
    },
    computed: {
        ...mapState('board', ['newNotice']),
        pointsTip() {
            let valList, templateList, template;
            if (this.formValidate.type === 1) {
                valList = this.formValidate.attackLevel;
                templateList = this.attackLevelList;
            } else {
                valList = this.formValidate.defenseType;
                templateList = this.defenseTypesList;
            }
            valList = valList || [''];
            let val = valList[valList.length - 1];
            if (!val) {
                return '';
            }
            template = templateList.find((item) => item.dictid === val);
            return template && template.memo;
        },
        reviewReportTitle() {
            if (this.currentTarget.id) {
                return `审核${this.currentTarget.type === 1 ? '攻击' : '防御'}报告 ${
                    this.currentTarget.targetName || ''
                }`;
            } else {
                // 未选定当前的审核报告数据，给一个默认的title
                return '审核报告';
            }
        },
    },
    watch: {
        newNotice(val, oldval) {
            if (val.sceneName) {
                if (val.sceneName === this.$route.query.sceneName) {
                this.getReportList();
                }
            }
        },
        currentType(newValue) {
            if (newValue === 2 && this.fileCol[0].type === 'expand') {
                this.fileCol.shift();
            } else if (newValue === 1 && this.fileCol[0].type !== 'expand') {
                this.fileCol.unshift({
                    type: 'expand',
                    width: 50,
                    render: (h, params) => {
                        return h('div', [
                            h(defenseFile, {
                                props: {
                                    row: this.defeFileList,
                                },
                            }),
                            h('div', {}, [
                                h(
                                    'h3',
                                    {
                                        style: {
                                            margin: '10px 0',
                                        },
                                    },
                                    '攻击时间：' + this.attackStartTime + ' - ' + this.attackEndTime
                                ),
                            ]),
                            h(screenRecord, {
                                props: {
                                    row: this.connectRecords,
                                },
                            }),
                        ]);
                    },
                });
            }
        },
    },
    async mounted() {
        await this.getIndustryTypes();
        await this.getAttackTypes();
        await this.getHwAttackLevelTypes();
        await this.getHwDefenseTypes();
        await this.getTaskList();
        this.setStyle();
        window.onresize = () => {
            this.setStyle();
        };
        console.log('出发提交');
    },
    methods: {
        textNull2Wu(text){ // 文本如果为空，返回‘无’
          text +=''
          if(text==='' || text==='undefined'|| text==='null'){
            return '-'
          }
          return text
        },
        // 获取应用靶标
        queryAllotTopoTargetList() {
            let params = {
                sceneId: this.$route.query.sceneId,
                projectId: this.$route.query.projectId,
                pageIndex: 1,
                pageSize: 9999,
                available: true
            }
            queryAllotTopoTargetList_old(params).then(res => {
                if(res.code == 1) {
                    this.targetList = res.data.items
                }else {
                    this.$Message.error(res.message)
                }
            })
        },
        onEditorBlur(quill){}, // 失去焦点事件
        onEditorFocus(quill){}, // 获得焦点事件
        onEditorChange(quill, refName){
            this.currQuillRefName = refName
        },
        // 隐藏模态框时，重置表单数据
        changeVisible(type) {
            if (!type) {
                this.$refs.formInline.resetFields()
            }
        },
        getTaskList() {
            return new Promise((resolve, reject) => {
                let params = {
                    page: 1,
                    pageSize: 10000,
                    testId: this.sceneId,
                    status: 'running',
                };
                taskList(params)
                    .then((res) => {
                        console.log('taskList',res)
                        if (res.data.code === 1) {
                            this.taskList = res.data.data.pageData;
                            if (this.taskList.length > 0) {
                                this.taskId = this.taskList[0].id;
                                this.taskName = this.taskList[0].name;
                            }
                            resolve();
                        }
                    })
                    .catch((err) => {});
            });
        },
        changeTask(id) {
            this.taskName = this.taskList.find((item) => item.id === id).name;
            this.refreshSceneList();
        },
        // 级联选择只展示叶子节点的内容
        renderFormat(label) {
            return label[label.length - 1];
        },
        // 复原修锁条件
        refreshSceneList() {
            this.type = '';
            this.industry = '';
            this.attackType = '';
            this.defenseTypes = [];
            this.attackLevel = [];
            this.level = '';
            this.statusModel = '';
            this.pageSize = 10;
            this.current = 1;
            this.publicTarget = '';
            this.targetName = '';
            this.getReportList();
        },
        // 获取目标危害程度
        getHwAttackLevelTypes() {
            return new Promise((resolve) => {
                allDirection({ dictTypeID: 'hwAttackLevelTypes' })
                    .then(({ code, message, attribute = {} }) => {
                        attribute = attribute.attribute || [];
                        if (code !== 1) {
                            this.$Message.warning(message);
                            return;
                        }
                        let list = [];
                        attribute.forEach((item) => (list = list.concat(item.dictEntryList)));
                        this.attackLevelList = list;
                        let parentNodeList = list.filter((item) => item.parentid === '');
                        this.extent4InjuryData = parentNodeList.map((item) => {
                            let ret = {
                                value: item.dictid,
                                label: item.dictname,
                                children: [],
                            };
                            list.forEach((subItem) => {
                                if (subItem.parentid === item.dictid) {
                                    // 将二级的字典遍历查询出来
                                    ret.children.push({
                                        value: subItem.dictid,
                                        label: subItem.dictname,
                                    });
                                }
                            });
                            return ret;
                        });
                    })
                    .catch(() => {
                        this.$Message.error('获取目标危害程度列表异常');
                    })
                    .finally(() => {
                        resolve();
                    });
            });
        },
        // 获取目标危害程度
        getHwDefenseTypes() {
            return new Promise((resolve) => {
                allDirection({ dictTypeID: 'hwDefenseTypes' })
                    .then(({ code, message, attribute = {} }) => {
                        attribute = attribute.attribute || [];
                        if (code !== 1) {
                            this.$Message.warning(message);
                            return;
                        }
                        let list = [];
                        attribute.forEach((item) => (list = list.concat(item.dictEntryList)));
                        this.defenseTypesList = list;
                        let parentNodeList = list.filter((item) => item.parentid === '');
                        this.extent4DefenseTypesData = parentNodeList.map((item) => {
                            let ret = {
                                value: item.dictid,
                                label: item.dictname,
                                children: [],
                            };
                            list.forEach((subItem) => {
                                if (subItem.parentid === item.dictid) {
                                    // 将二级的字典遍历查询出来
                                    ret.children.push({
                                        value: subItem.dictid,
                                        label: subItem.dictname,
                                    });
                                }
                            });
                            return ret;
                        });
                    })
                    .catch(() => {
                        this.$Message.error('获取目标危害程度列表异常');
                    })
                    .finally(() => {
                        resolve();
                    });
            });
        },
        change(val) {
            this.showProgress = val;
        },
        // 打包下载攻击报告以及关联的防御报告
        downloadReports() {
            this.downloading1 = true;
            this.showProgress = true;
            let fileList = this.defeFileList.concat(this.fileList);
            downloadReports(
                this.taskId,
                fileList.map((item) => item.reportId),
                this.downFileProgress
            )
                .then(({ data }) => {
                    this.total = 0;
                    if (data.type == 'application/octet-stream') {
                        const downloadElement = document.createElement('a');
                        const href = window.URL.createObjectURL(data);
                        downloadElement.href = href;
                        downloadElement.download = `${this.groupName}-${this.currentTargetName}-${this.reportName}关联报告打包下载.zip`;
                        document.body.appendChild(downloadElement);
                        downloadElement.click();
                        document.body.removeChild(downloadElement); // 下载完成移除元素
                        window.URL.revokeObjectURL(href); // 释放掉blob对象
                        this.$Message.info('报告下载成功');
                    } else {
                        this.$Message.warning('下载失败，不存在文件数据');
                    }
                    this.downloading1 = false;
                })
                .catch((error) => {
                    his.progressStatus = 'wrong';
                    this.$Message.error('下载异常');
                    this.downloading1 = false;
                })
                .finally(() => {
                    this.progress = 100;
                    setTimeout(() => {
                        this.showProgress = false;
                        this.progressStatus = 'active';
                        this.progress = 0;
                    }, 2000);
                });
        },
        // 导出任务下的所有报告
        downloadAllReports() {
            this.downloading = true;
            this.showProgress = true;
            downloadReports(this.taskId, [], this.downFileProgress)
                .then(({ data }) => {
                    this.total = 0;
                    if (data.type == 'application/octet-stream') {
                        const downloadElement = document.createElement('a');
                        const href = window.URL.createObjectURL(data);
                        downloadElement.href = href;
                        downloadElement.download = `${this.taskName}.zip`;
                        document.body.appendChild(downloadElement);
                        downloadElement.click();
                        document.body.removeChild(downloadElement); // 下载完成移除元素
                        window.URL.revokeObjectURL(href); // 释放掉blob对象
                        this.$Message.info('报告下载成功');
                    } else {
                        this.$Message.warning('下载失败，不存在文件数据');
                    }
                    this.downloading = false;
                })
                .catch((error) => {
                    his.progressStatus = 'wrong';
                    this.$Message.error('下载异常');
                    this.downloading = false;
                })
                .finally(() => {
                    this.progress = 100;
                    setTimeout(() => {
                        this.showProgress = false;
                        this.progressStatus = 'active';
                        this.progress = 0;
                    }, 2000);
                });
        },
        downFileProgress(progress) {
            let currentProgress = progress.loaded * 1; //B单位
            if (this.total) {
                this.total += currentProgress;
            } else {
                this.total = currentProgress;
            }
            currentProgress = this.total - currentProgress ? currentProgress : currentProgress / 2;
            let rate = (((this.total - currentProgress) / this.total) * 100).toFixed(2) * 1;
            if (!this.rate || rate > this.rate) {
                this.progress = rate;
            }
        },
        // 获取行列列表
        getIndustryTypes() {
            return new Promise((resolve) => {
                allDirection({ dictTypeID: 'hwIndustryTypes' })
                    .then(({ code, message, attribute = {} }) => {
                        attribute = attribute.attribute || [];
                        if (code !== 1) {
                            this.$Message.warning(message);
                            return;
                        }
                        let list = [];
                        attribute.forEach((item) => (list = list.concat(item.dictEntryList)));
                        this.industryList = list;
                    })
                    .catch(() => {
                        this.$Message.error('获取行业列表异常');
                    })
                    .finally(() => {
                        resolve();
                    });
            });
        },
        // 获取攻击类型列表
        getAttackTypes() {
            return new Promise((resolve) => {
                allDirection({ dictTypeID: 'hwAttackTypes' })
                    .then(({ code, message, attribute = {} }) => {
                        attribute = attribute.attribute || [];
                        if (code !== 1) {
                            this.$Message.warning(message);
                            return;
                        }
                        let list = [];
                        attribute.forEach((item) => (list = list.concat(item.dictEntryList)));
                        this.attackList = list;
                    })
                    .catch(() => {
                        this.$Message.error('获取攻击类型列表异常');
                    })
                    .finally(() => {
                        resolve();
                    });
            });
        },
        // 修改模态框状态
        changeModalStatus(type) {
            if (!type) {
                this.$refs['formValidate'].resetFields();
            }
        },
        // 设置高度
        setStyle() {
            clearTimeout(this.refreshTimer);
            this.refreshTimer = setTimeout(() => {
                window.fullHeight = document.documentElement.clientHeight;
                window.fullWidth = document.documentElement.clientWidth;
                this.fullHeight = window.fullHeight;
                this.fullWidth = window.fullWidth;
                this.contentHei = this.fullHeight - 36 - 50; // 80是头部高度  60是上下padding
                this.pageSize = Math.floor((this.contentHei - 167) / 96) || 1;
                this.getReportList();
            }, 200);
        },
        // 返回icon管理
        returnCompany() {
            this.$router.push({
                path: '/referee',
            });
        },
        // 报告列表
        getReportList() {
            this.$nextTick(() => {
                let params = {
                    page: this.reportPage,
                    pageSize: this.pageSize,
                    taskId: this.taskId,
                    status: this.statusModel,
                    industry: this.industry,
                    attackType: this.attackType,
                    level: this.level,
                    type: this.type,
                    defenseType: this.defenseTypes.length
                        ? this.defenseTypes[this.defenseTypes.length - 1]
                        : undefined,
                    publicTarget: this.publicTarget
                        ? this.publicTarget === '1'
                            ? true
                            : false
                        : undefined,
                    attackLevel: this.attackLevel.length
                        ? this.attackLevel[this.attackLevel.length - 1]
                        : undefined,
                    targetName: this.targetName,
                };
                reportList(params)
                    .then((res) => {
                        if (res.data.code === 1) {
                            let getData = res.data.data;
                            this.dataTotal = getData.totalCount;
                            let list = getData.pageData;
                            this.reportList = list.map((item) => {
                                item.attackTypeName = this.getValueByList(
                                    item.attackType,
                                    this.attackList
                                );
                                item.industryName = this.getValueByList(
                                    item.industry,
                                    this.industryList
                                );
                                item.attackLevelName = this.getValueName(
                                    item.attackLevel,
                                    this.attackLevelList
                                );
                                item.defenseTypeName = this.getValueName(
                                    item.defenseType,
                                    this.defenseTypesList
                                );
                                return item;
                            });
                        } else {
                            this.$Message.warning(res.data.message);
                        }
                    })
                    .catch((err) => {
                        console.log(err);
                    });
            });
        },
        // 从列表中找出对应ID的名称，无法获取时返回ID
        getValueByList(id, list) {
            let item = list.find((item) => item.dictid === id);
            return item ? item.dictname : id;
        },
        // 递归获取级联选择框的数据
        getValueName(value, operatedList, list = []) {
            let item = operatedList.find((item) => item.dictid === value) || {};
            list.unshift(item.dictname);
            if (item.parentid) {
                this.getValueName(item.parentid, operatedList, list);
            }
            return list.join(' / ');
        },
        // 文件列表
        getFileList(id, type, targetName, groupName) {
            this.currentType = type;
            this.fileModal = true;
            this.defeFileList = [];
            reportFileData(id)
                .then((res) => {
                    if (res.data.code === 1) {
                        this.attackStartTime = res.data.data.startTime;
                        this.attackEndTime = res.data.data.endTime;
                        this.reportName = res.data.data.reportName;
                        this.defeFileList = res.data.data.defenseFiles;
                        this.connectRecords = res.data.data.connectRecords;
                        this.fileList = res.data.data.files;
                        this.currentTargetName = targetName;
                        this.groupName = groupName;
                    }
                })
                .catch((err) => {
                    console.log(err);
                });
        },
        downLoadFile(row) {
            this.currentFileId = row.id;
            this.downloading2 = true;
            let windowsUrl = window.location.href;
            windowsUrl = windowsUrl.split('//');
            let getIp = windowsUrl[1].split('/')[0];
            getIp = getIp.split(':')[0];
            var objurl = `${getIp}/Learn/${row.path}`;
            // 处理下载地址与当前网站不同源，download属性不生效的问题
            const x = new window.XMLHttpRequest();
            x.open('GET', `http://${objurl}`, true);
            x.responseType = 'blob';
            x.onload = () => {
                this.downloading2 = false;
                const url = window.URL.createObjectURL(x.response);
                const a = document.createElement('a');
                a.href = url;
                a.download = row.name;
                a.click();
            };
            x.send();
        },
        // 审核
        reviewBtn(row) {
            this.reportID = row.id;
            this.currentTarget = row;
            this.formValidate = {
                attackType: row.attackType,
                defenseType: this.getCascaderValue(row.defenseType, 'defense'),
                approvalInfo: '',
                status: '',
                attackLevel: this.getCascaderValue(row.attackLevel, 'attack'),
                type: row.type,
            };
            this.reviewReportModal = true;
        },
        // 将列表中的危害程度转义为Cascader组件需要的数据格式
        getCascaderValue(val, type) {
            return this.unfoldList(val, type);
        },
        // 多层递归，拼装数据
        unfoldList(val, type, list = []) {
            let templateList = type === 'attack' ? this.attackLevelList : this.defenseTypesList;
            let template = templateList.find((item) => item.dictid === val);
            if (!template) {
                return list;
            }
            list.unshift(val);
            if (template.parentid !== '') {
                // 存在父级元素，递归调用至无父级
                this.unfoldList(template.parentid, type, list);
            }
            return list;
        },
        // 提交审核
        saveReport(name) {
            this.$refs[name].validate((valid) => {
                if (valid) {
                    let params = {
                        approvalInfo: this.formValidate.approvalInfo,
                        attackType: this.formValidate.attackType,
                        defenseType: this.formValidate.defenseType.length
                            ? this.formValidate.defenseType[
                                  this.formValidate.defenseType.length - 1
                              ]
                            : undefined,
                        reportId: this.reportID,
                        // 'score':this.formValidate.score,
                        status: parseInt(this.formValidate.status),
                        attackLevel: this.formValidate.attackLevel.length
                            ? this.formValidate.attackLevel[
                                  this.formValidate.attackLevel.length - 1
                              ]
                            : undefined,
                    };
                    if (String(params.status) === '2') {
                        // 通过时，记录危险等级和攻击方扣分
                        params.level = this.formValidate.level;
                        params.score = this.formValidate.score;
                    }
                    this.submitBtnLoad = true;
                    reviewReport(JSON.stringify(params))
                        .then((res) => {
                            if (res.data.code === 1) {
                                this.reviewReportModal = false;
                                this.$Message.success({
                                    content: '提交成功',
                                    duration: 3,
                                });
                                this.getReportList();
                            } else {
                                this.$Message.error({
                                    content: res.data.message,
                                    duration: 3,
                                });
                            }
                            this.submitBtnLoad = false;
                        })
                        .catch((err) => {
                            this.submitBtnLoad = false;
                            console.log(err);
                        });
                } else {
                    this.$Message.error({
                        content: '请完善信息！',
                        duration: 3,
                    });
                }
            });
        },
        cancelModel(name) {
            this.$refs[name].resetFields();
        },
        // 修改审核
        modifyReviewBtn(row) {
            this.reportID = row.id;
            this.reviewReportModal = true;
            this.currentTarget = row;
            this.$set(
                this.formValidate,
                'attackLevel',
                this.getCascaderValue(row.attackLevel, 'attack')
            );
            this.$set(
                this.formValidate,
                'defenseType',
                this.getCascaderValue(row.defenseType, 'defense')
            );
            this.$set(this.formValidate, 'score', row.score);
            this.$set(this.formValidate, 'type', row.type);
            reportFileData(row.id)
                .then((res) => {
                    if (res.data.code === 1) {
                        let getData = res.data.data;
                        this.$set(this.formValidate, 'attackType', getData.attackType);
                        this.$set(this.formValidate, 'approvalInfo', getData.approvalInfo);
                        this.$set(this.formValidate, 'status', String(getData.status));
                        this.$set(this.formValidate, 'level', getData.level);
                    }
                })
                .catch((err) => {
                    console.log(err);
                });
        },
        // 补充上传文件
        // uploadFile(row){
        //     this.reportID = row.id
        //     this.$refs['uploadIcon'].clearFiles()
        //     this.uploadModal = true
        // },
        // 取消
        cancleUpload() {
            this.$refs['uploadIcon'].clearFiles();
            this.creatFormValidate.file = null;
            this.uploadModal = false;
        },
        handleUploadIcon(file) {
            this.creatFormValidate.file = file;
            return false;
        },
        creatIconHandleSubmit() {
            if (this.creatFormValidate.file == null) {
                this.$Message.error({
                    content: '请选择上传文件！',
                    duration: 3,
                });
                return false;
            }
            this.uploadLoading = true;
            let formData = new window.FormData();
            formData.append('file', this.creatFormValidate.file);
            this.axios
                .post(`${this.baseURL}/referee/referee/upload/${this.reportID}`, formData, {
                    headers: { 'Content-type': 'multipart/form-data' },
                    timeout:0,
                })
                .then((res) => {
                    console.log(res);
                    if (res.data.code == 1) {
                        this.$Message.success({
                            content: '上传成功',
                            duration: 3,
                        });
                        this.creatFormValidate.file = null;
                        this.uploadModal = false;
                        this.getReportList();
                    } else {
                        this.$Message.error({
                            content: res.data.message,
                            duration: 3,
                        });
                    }
                    this.uploadLoading = false;
                })
                .catch((err) => {
                    console.log(err);
                    this.uploadLoading = false;
                    this.$Message.error('服务器连接失败！');
                });
        },
        // 过滤
        changePageNum(val) {
            this.reportPage = val;
            this.getReportList();
        },
        searchBtn() {
            this.getReportList();
        },
        // 清除
        clearProName() {
            this.serchProjectName = '';
        },
        clearSceneName() {
            this.serchSceneName = '';
        },
        clearTaskName() {
            this.serchTaskName = '';
        },
        selectStatus() {
            this.reportPage = 1;
            this.getReportList();
        },
    },
};
</script>
<style scoped>
.points-tip {
    margin-top: 4px;
    word-wrap: break-word;
    word-break: break-all;
}
.page-wrap {
    /* padding: 25px; */
}
.page-wrap-query {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}
.page-wrap-query /deep/ .ivu-cascader-rel .ivu-input {
    border-radius: 20px;
}
.reset-color /deep/ .ivu-select-selected-value {
    color: unset !important;
}
.page-content {
    background-color: #fff;
    border-radius: 10px;
}
.img-header {
    display: flex;
    justify-content: flex-end;
    /* padding: 20px 20px 0 20px; */
    margin: 15px 0;
}
.addressIcon {
    display: inline-block;
    height: 14px;
    width: 12px;
    background: url('../../assets/globalIcon/addressIcon.png') no-repeat center;
    background-size: 100% 100%;
    margin-bottom: -1px;
}
.content-wrap {
    overflow-x: hidden;
    overflow-y: auto;
    /* padding: 0 20px; */
}

.content-wrap::-webkit-scrollbar {
    /*滚动条整体样式*/
    width: 8px; /*高宽分别对应横竖滚动条的尺寸*/
    height: 4px;
}
.content-wrap::-webkit-scrollbar-thumb {
    /*滚动条里面小方块样式*/
    border-radius: 5px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
    -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
    background: rgba(209, 209, 209, 0.6);
}
.content-wrap::-webkit-scrollbar-track {
    /*滚动条里面轨道样式*/
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
    -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    background: rgba(179, 179, 179, 0.1);
}
.inline {
    display: flex;
}
.inline /deep/ .ivu-form-item {
    width: 50%;
}
</style>

<style>
.create-vulnerability-modal .ql-snow .ql-tooltip {
    z-index: 999;
}
  .create-vulnerability-modal .editor .ql-container {
    height: 200px;
}
</style>
